package com.hui.tset01.controller;

import com.hui.tset01.domain.dto.UserDto;
import com.hui.tset01.domain.vo.UserVo;
import com.hui.tset01.service.UserService;
import com.hui.tset01.util.Result;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/user/login")
    public Result<UserVo> login(@RequestBody UserDto userDto) {
        log.info("登录{}", userDto);
        return Result.success(userService.login(userDto));
    }
}
